<?php if($this->session->flashdata('success')): ?>
<div class="alert_success">
	<p>
		<img class="middle" alt="Success" src="<?=site_url()?>assets/images/icon_accept.png">
		Success Upload Data From <?=$this->session->userdata('user_name');?>
	</p>
</div>
<?php endif;?>

<?php if($this->session->flashdata('error')): ?>
<div style="margin-bottom:20px" class="alert_error">
					<p>
						<img class="middle" alt="Error" src="<?=site_url()?>assets/images/icon_error.png">
						Error Upload Data From <?=$this->session->userdata('user_name');?>
					</p>
</div>
<?php endif;?>
				
<div class="inner">
				<h2><?=$title;?></h2><br/>
				
				<form action="<?=site_url('myfile/do_upload');?>" enctype="multipart/form-data"  method="post" id="form_login" name="form_login">
					<p>
					    <label><?=lang('file')?>:</label>
					    <?=form_upload('userfile');?>
					</p>
					
					<p>
						<label><?=lang('directory')?>:</label>
						<select name="id">
							<option value="0">Root Directory</option>
							<?php foreach($dir as $rec):?>
								 <option value="<?=$rec['file_id']?>">&nbsp;&nbsp;<?=$rec['file_name']?></option>
										<?php foreach($parent_dir as $rec2):?>
											<?php if($rec['file_id']==$rec2['folder_id']):?>
													<option value="<?=$rec2['file_id'];?>">&nbsp;&nbsp;&nbsp;<?=$rec2['file_name'];?></option>
											
													<?php foreach($parent_dir as $rec3):?>
													<?php if($rec2['file_id']==$rec3['folder_id']):?>
															<option value="<?=$rec3['file_id'];?>">&nbsp;&nbsp;&nbsp;&nbsp;<?=$rec3['file_name'];?></option>
													
														<?php foreach($parent_dir as $rec4):?>
														<?php if($rec3['file_id']==$rec4['folder_id']):?>
															<option value="<?=$rec4['file_id'];?>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?=$rec4['file_name'];?></option>
														
															<?php foreach($parent_dir as $rec5):?>
															<?php if($rec4['file_id']==$rec5['folder_id']):?>
																<option value="<?=$rec5['file_id'];?>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?=$rec5['file_name'];?></option>
															
																<?php foreach($parent_dir as $rec6):?>
																<?php if($rec5['file_id']==$rec6['folder_id']):?>
																	<option value="<?=$rec6['file_id'];?>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?=$rec6['file_name'];?></option>
																
																	<?php foreach($parent_dir as $rec7):?>
																	<?php if($rec6['file_id']==$rec7['folder_id']):?>
																	<option value="<?=$rec7['file_id'];?>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?=$rec7['file_name'];?></option>
																	<?php endif;?>
																	<?php endforeach;?>
																
																
																<?php endif;?>
																<?php endforeach;?>
															
															<?php endif;?>
															<?php endforeach;?>
														
														<?php endif;?>
														<?php endforeach;?>
													
													<?php endif;?>
													<?php endforeach;?>
											
											<?php endif;?>
										<?php endforeach;?>		
							<?php endforeach;?>
						</select>
					</p>
					
					<p>
					    <input type="submit" class="button_dark" value="<?=lang('upload');?>"/>	
					</p>
				</form>
</div>